// ///////////////////////////// MIT License //////////////////////////////////// //
//                                                                                //
// Copyright (c) 2010 David Zsolt Manrique                                        //
//                    david.zsolt.manrique@gmail.com                              //
//                                                                                //
// Permission is hereby granted, free of charge, to any person obtaining a copy   //
// of this software and associated documentation files (the "Software"), to deal  //
// in the Software without restriction, including without limitation the rights   //
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell      //
// copies of the Software, and to permit persons to whom the Software is          //
// furnished to do so, subject to the following conditions:                       //
//                                                                                //
// The above copyright notice and this permission notice shall be included in     //
// all copies or substantial portions of the Software.                            //
//                                                                                //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR     //
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,       //
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE    //
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER         //
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,  //
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN      //
// THE SOFTWARE.                                                                  //
//                                                                                //
// ////////////////////////////////////////////////////////////////////////////// //

#include "inout.h"

int main(int argc, char** argv)
{
	structure_t sp;
	sp.unit_cell.setZero();
	std::istringstream("1 H 1.0 0.0  0.0  0.0  0.0  0.0  0.0  0.0") >> input<atom_list_t,def,debug>(sp.atom_list);
	std::istringstream("2 H 1.0 0.0  0.0  0.0  1.0  0.0  0.0  0.0") >> input<atom_list_t,def,debug>(sp.atom_list);
	std::istringstream("3 H 1.0 0.0  0.0  1.0  0.0  0.0  0.0  0.0") >> input<atom_list_t,def,debug>(sp.atom_list);
	std::istringstream("4 H 1.0 0.0  1.0  0.0  0.0  0.0  0.0  0.0") >> input<atom_list_t,def,debug>(sp.atom_list);
	sp.topology.connect(1,2);
	sp.topology.connect(1,3);
	sp.topology.connect(1,4);
	sp.group.add("1",1);
	sp.group.add("2",2);
	sp.group.add("A",3);
	sp.group.add("A",4);
	internal_potential::bond::harm::read("bond harm 5.0 1.3 : 1,2,7 2,3  1,2",sp);
	internal_potential::bond::harm::read("bond harm 5.0 1.5 : 1,2 ",sp);
	internal_potential::angle::harm::read("angle harm 5.0 100.0 : 1,2,4 2,3,4",sp);
	std::cout << out<structure_t>(sp);

	std::cout << out<atom_list_t,def,xyz>(sp.atom_list);
	std::cout << out<atom_list_t,def,xyz>(sp.atom_list);
	std::cout << out<atom_list_t,def,xyz>(sp.atom_list);
	std::cout << out<atom_list_t,def,xyz>(sp.atom_list);

	system("pause");
	return 0;
}


